home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 27 / 027.d81 / muzic maker (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  8.1 KB  |  270 lines

  1. 2 gosub58000:poke53281,0:poke53280,6:poke53277,0
  2. 3 print"[147]       muzik-maker by mark jordan"
  3. 4 print"        just follow the prompts"
  4. 8 fort=1to500:ifpeek(198)=0thennext
  5. 9 poke198,0
  6. 10 ifa$="*"thenfort=1to3:f(t)=peek(49416+t):e(t)=f(t)-1:next:goto90
  7. 15 print"[147][144]","  please stand by"
  8. 20 poke53281,1:poke53280,1:poke55279,10
  9. 25 dimnv$(11),nf$(11),n1$(11)
  10. 30 fort=0to11:readnv$(t):next
  11. 35 fort=0to11:readnf$(t):next
  12. 40 fort=0to22:reada:poke704+t,a:next:fort=23to63:poke704+t,0:next
  13. 45 fort=49152to49407:reada:poket,a:next
  14. 50 fort=49568to49637:reada:poket,a:next
  15. 55 m=155:da=49424:rs=49425:up=49421:hp=49422:f(1)=1:f(2)=1:f(3)=1
  16. 60 dimn$(3,m),oc(3,m),d(3,m),np(3,m),du(3,m)
  17. 65 sc$="":s$="          ":sp$=sc$+s$+s$+s$:s1$=s$+s$+s$+s$
  18. 70 n$=""
  19. 75 cb$=left$(n$,19)+s1$+s1$+s1$+s1$
  20. 80 gosub130
  21. 85 gosub890
  22. 90 poke53281,1:gosub825
  23. 95 gosub305
  24. 100 gosub850
  25. 105 gosub315
  26. 110 gosub135
  27. 115 gosub650
  28. 120 gosub150
  29. 125 end
  30. 130 sys65418:s=54272:forl=stos+24:pokel,0:next:return
  31. 135 poke2,4:pokev+21,0
  32. 140 fort=1ton:poke49416+t,e(t)+1:poke49413+t,0:poke49407+t,e(t)+1:next
  33. 145 poke49433,0:sys49152:return
  34. 150 form=1ton:w=(m-1)*7
  35. 155 poke1307,m+176
  36. 160 q=(m-1)*4:ad(m)=peek(da+w):sr(m)=peek(rs+w)
  37. 163 pu(m)=peek(up+w):ph(m)=peek(hp+w)
  38. 165 geta$:ifa$=""then165
  39. 167 ifa$="q"thengosub60000:gosub650:goto165
  40. 170 ifa$="d"thenad(m)=(ad(m)+1)and255
  41. 175 ifa$="a"thenad(m)=(ad(m)+16)and255
  42. 180 ifa$="r"thensr(m)=(sr(m)+1)and255
  43. 185 ifa$="s"thensr(m)=(sr(m)+16)and255
  44. 190 ifa$=chr$(133)thenwf(m)=17
  45. 195 ifa$=chr$(134)thenwf(m)=33
  46. 200 ifa$=chr$(135)thenwf(m)=65
  47. 205 ifa$=chr$(136)thenwf(m)=129
  48. 210 ifa$="0"thenwf(m)=0
  49. 215 ifa$="&"thengosub910
  50. 230 ifa$="^"then300
  51. 235 ifa$="p"thenpu(m)=pu(m)+16:ifpu(m)>255thenpu(m)=0
  52. 240 ifa$="h"thenph(m)=ph(m)+1:ifph(m)>15thenph(m)=0
  53. 245 ifa$="_"thengosub130:gosub535:sys49152
  54. 250 ifa$="+"thengosub130:print"[147]":goto100
  55. 255 ifa$="$"thengosub130:gosub870:gosub650
  56. 260 ifa$="1"ora$="2"ora$="3"thengosub130:gosub525:sys49152
  57. 265 printleft$(n$,18)
  58. 270 print"decay   =   [157][157][157]"ad(m)and15
  59. 273 print"attack  =   [157][157][157]"(ad(m)and240)/16
  60. 275 print"sustain =   [157][157][157]"(sr(m)and240)/16
  61. 277 print"release =   [157][157][157]"sr(m)and15
  62. 280 poke49413+m,wf(m):pokeda+w,ad(m):pokers+w,sr(m)
  63. 285 pokeup+w,pu(m):pokehp+w,ph(m)
  64. 290 print"pulse   =    [157][157][157][157]"int(pu(m)/16):print"hi pulse=    [157][157][157][157]"ph(m)
  65. 295 goto165
  66. 300 next:goto150
  67. 305 input"[147]how many voices (1 - 3)3[157][157][157]";n:ifn<1orn>3then305
  68. 310 print"[147]":return
  69. 315 forj=1ton:k=e(j):du(j,0)=4:oc(j,0)=4:n$(j,0)="c"
  70. 320 k=k+1:tn=tn+1:z=0
  71. 325 gosub385:gosub440:gosub465
  72. 330 li=10:gosub845:print,"[154]check note position":gosub510
  73. 335 print,"press:   _ [146] to redo"
  74. 340 print,"         * [146] to end voice"j
  75. 345 print,"[151]type any other key to continue[154]"
  76. 350 geta$:ifa$=""then350
  77. 355 gosub130
  78. 360 ifa$="*"then375
  79. 365 ifa$="_"then325
  80. 370 goto320
  81. 375 e(j)=k:nextj:gosub790
  82. 380 return
  83. 385 pd=du(j,k-1)
  84. 390 li=6:gosub845:print,"[154]note "k"[157] , voice   [157][157][157]"j
  85. 395 print,"note duration"
  86. 400 print," 1 = whole note       ",," 2 = half note        ";
  87. 405 print,," 4 = quarter note, etc"
  88. 410 print,"add period for dotted notes"
  89. 415 print,"[155](previous duration:  [152]"pd")"
  90. 420 x=pd:gosub640:ifx<1orx>16then420
  91. 422 du(j,k)=x:x$=str$(x)
  92. 425 ifval(x$)<1thenx=val(mid$(x$,3)):z=1/x*te
  93. 430 d(j,k)=1/x*te*2-4+z
  94. 435 return
  95. 440 po=oc(j,k-1)
  96. 445 li=12:gosub845:print,"[154]octave (0 - 7)"
  97. 450 print,"[155](previous octave was [152]"po")[151]"
  98. 455 x=po:gosub640:ifx<0orx>7then455
  99. 460 oc(j,k)=x:return
  100. 465 pn$=n$(j,k-1):y$=pn$:printcb$:print"[145]                                    "
  101. 470 li=11:gosub845:print,"[154]note  (a - g) ":print," + [146]sharp  - [146]flat"
  102. 475 print,"[155](previous note was [152]"pn$")[151]"
  103. 480 printcb$:input"          ";y$
  104. 485 ify$="\"then495
  105. 490 ifleft$(y$,1)<"a"orleft$(y$,1)>"g"then480
  106. 495 n$(j,k)=y$:gosub740
  107. 500 pokev+1,141-((28*(oc(j,k)-4))+d*4)
  108. 505 return
  109. 510 pokes+5,132:pokes+6,132
  110. 515 pokes,((np(j,k)/256)-int(np(j,k)/256))*256:pokes+1,int(np(j,k)/256)
  111. 520 pokes+4,33:pokes+24,15:return
  112. 525 vo=val(a$):ifvo>nthenreturn
  113. 530 h=peek(49407+vo):goto545
  114. 535 input"[147]alter which voice";v$:vo=val(v$):ifvo<1orvo>3then535
  115. 540 h=1:input"[147]start with what note";h
  116. 545 fork=htoe(vo):j=vo:z=0
  117. 550 ifd(j,k)=0then560
  118. 555 pd=du(j,k):po=oc(j,k):pn$=n$(j,k):y$=pn$
  119. 560 print"[147]","[157][157]press  _ [146] to alter note"
  120. 563 print,"[157][157][157]any other key to continue"
  121. 565 print,"note   #"k" -  "pn$
  122. 570 print,"duration  - "pd
  123. 575 print,"octave    - "po
  124. 580 geta$:ifa$=""then580
  125. 585 ifa$="_"thengosub600
  126. 590 next
  127. 595 gosub650:gosub135:return
  128. 600 print"[147]":gosub850:gosub390:gosub445:gosub470
  129. 605 j1=(j-1)*768:n1=np(j,k)/256:it=49664
  130. 610 pokeit+k-1+j1,d(j,k):pokeit+255+k+j1,(n1-int(n1))*256
  131. 615 pokeit+511+k+j1,n1
  132. 620 print"press  _ [146] to redo, otherwise any key":gosub510
  133. 625 geta$:ifa$=""then625
  134. 630 ifa$="_"then600
  135. 635 gosub130:return
  136. 640 qq$="         enter 'exit' to quit":printcb$:ag$=""
  137. 642 print""qq$:input"          ";ag$
  138. 644 ifag$="exit"thengosub60000:goto640
  139. 645 ifag$<>""thenx=val(ag$):printcb$:return
  140. 646 printcb$:return
  141. 650 print"[147]press:    [154] a [146] to increment attack"
  142. 655 print," d [146] to increment decay"
  143. 660 print,"[156] s [146] to increment sustain"
  144. 665 print,"[152] r [146] to increment release"
  145. 670 print,"[155] p [146] to increment lo pulse"
  146. 675 print,"[159] h [146] to increment hi pulse"
  147. 680 print"[129] voice:[146]   [166][166][166] ^ to change voices"
  148. 685 print"[129]       [146]   [166][166][166] _ to alter (1 2 3)"
  149. 690 print,"[152][166][166][166] + to append       "
  150. 695 print,"[166][166][166] $ to save         "
  151. 700 print,"[166][166][166] & to play section "
  152. 710 print,"[154] f1 [146] for triangle wave"
  153. 715 print," f3 [146] for sawtooth wave"
  154. 720 print,"[156] f5 [146] for pulse    wave"
  155. 725 print,"[154] f7 [146] for noise"
  156. 730 print,"[152] 0  [146] to shut off voice"
  157. 732 print," q  [146] to quit[144]"
  158. 735 pokev+21,0:return
  159. 740 c=0:d=0
  160. 745 ifn$(j,k)="\"thennp(j,k)=1:goto785
  161. 750 ifn$(j,k)=n1$(c)thennp(j,k)=268.234375*(1.059465^c)*2^oc(j,k):goto785
  162. 755 ifsf$="-"then780
  163. 760 onc+1 goto770,765,770,765,765,770,765,770,765,770,765,765
  164. 765 d=d+1
  165. 770 c=c+1:ifc>11then785
  166. 775 goto750
  167. 780 onc+1goto765,770,765,770,765,765,770,765,770,765,770,765
  168. 785 return
  169. 790 it=49664:fori=1ton
  170. 795 fort=f(i)toe(i)
  171. 800 pokeit+t-1,d(i,t)
  172. 805 pokeit+255+t,((np(i,t)/256)-int(np(i,t)/256))*256
  173. 810 pokeit+511+t,int(np(i,t)/256)
  174. 815 next:it=it+768:next
  175. 820 return
  176. 825 sf$="-":input"[147][152]program in sharps (+)or flats (-)-[157][157][157]";sf$:
  177. 830 ifsf$="+"thenfort=0to11:n1$(t)=nv$(t):next
  178. 835 ifsf$="-"thenfort=0to11:n1$(t)=nf$(t):next
  179. 837 te=64:input"[147]tempo (fast,med,slow)m[157][157][157]";te$
  180. 838 ifte$="s"thente=80
  181. 839 ifte$="f"thente=48
  182. 840 return
  183. 845 printleft$(n$,7):fort=1to12:printsp$;:next:printleft$(n$,li):return
  184. 850 v=53248:poke2040,11:pokev+21,1
  185. 855 pokev,33:pokev+1,141:pokev+2,26:pokev+39,0
  186. 860 printleft$(n$,6)
  187. 865 fort=1to2:fori=1to5:print"[151][175][175][175][175][175]":next:print:next:return
  188. 870 input"[147]name of song";so$
  189. 875 open1,8,1,so$:fort=49408tot+2:poket,0:next
  190. 880 poke780,78:poke78,0:poke79,192:poke781,0:poke782,203:sys65496
  191. 885 gosub135:close1:return
  192. 890 print"[147]to load and append press  * "
  193. 895 geta$:ifa$=""then895
  194. 900 ifa$="*"theninput"song title";t$:loadt$,8,1
  195. 905 sys49616:return
  196. 910 input"[147]starting note";ss
  197. 915 se=e(1)+1:input"ending note";se
  198. 920 poke49433,ss:poke49417,se:poke49408,ss:poke49409,ss:poke49410,ss
  199. 925 gosub130:gosub650:sys49152:return
  200. 930 data c,c+,d,d+,e,f,f+,g,g+,a,a+,b
  201. 935 data c,d-,d,e-,e,f,g-,g,a-,a,b-,b
  202. 940 data0,126,0,1,255,128,3,255,192,15,255,240,15,255,240,3
  203. 945 data255,192,1,255,128,0,126
  204. 950 data 120,169,13,141,20,3,169,192
  205. 955 data 141,21,3,88,96,173,0,193
  206. 960 data 205,9,193,208,23,173,25,193
  207. 965 data 141,0,193,141,1,193,141,2
  208. 970 data 193,234,234,234,169,0,133,251
  209. 975 data 133,252,133,253,165,251,240,20
  210. 980 data 198,251,165,252,240,78,198,252
  211. 985 data 165,253,208,3,76,194,192,198
  212. 990 data 253,76,160,193,173,3,193,240
  213. 995 data 20,173,6,193,41,254,141,4
  214. 1000 data 212,169,0,141,3,193,165,2
  215. 1005 data 133,251,76,48,192,172,0,193
  216. 1010 data 185,0,194,133,251,185,0,195
  217. 1015 data 141,0,212,185,0,196,141,1
  218. 1020 data 212,238,0,193,173,6,193,141
  219. 1025 data 4,212,169,4,141,3,193,133
  220. 1030 data 2,76,48,192,173,4,193,240
  221. 1035 data 20,173,7,193,41,254,141,11
  222. 1040 data 212,169,0,141,4,193,165,2
  223. 1045 data 133,252,76,54,192,172,1,193
  224. 1050 data 185,0,197,133,252,185,0,198
  225. 1055 data 141,7,212,185,0,199,141,8
  226. 1060 data 212,238,1,193,173,7,193,141
  227. 1065 data 11,212,169,1,141,4,193,76
  228. 1070 data 54,192,173,5,193,240,20,173
  229. 1075 data 8,193,41,254,141,18,212,169
  230. 1080 data 0,141,5,193,165,2,133,253
  231. 1085 data 76,63,192,172,2,193,185,0
  232. 1090 data 200,133,253,185,0,201,141,14
  233. 1095 data 212,185,0,202,141,15,212,238
  234. 1100 data 2,193,173,8,193,141,18,212
  235. 1105 data 169,1,141,5,193,76,63,192
  236. 1160 data 160,0,162,0,185,13,193,153
  237. 1165 data 2,212,200,232,224,2,208,244
  238. 1170 data 200,232,224,5,240,9,185,13
  239. 1175 data 193,153,2,212,76,176,193,200
  240. 1180 data 200,192,21,240,3,76,162,193
  241. 1185 data 169,15,141,24,212,76,49,234
  242. 1190 data 169,194,133,252,169,0,133,251
  243. 1195 data 168,162,247,145,251,200,208
  244. 1200 data 251,230,252,232,208,246,96
  245. 58000 nm$="[205]ark [202]ordan":pr$="[205]uzic [205]aker"
  246. 58010 deffncn(n)=int(19-n/2)
  247. 58020 t$="                         ":c=0:c$="":print"[147]":poke53281,0
  248. 58030 printspc(7)""t$:printspc(7)"                         [146]"
  249. 58040 printtab(fncn(len(pr$)))"[145]"pr$
  250. 58050 printspc(7)""t$:print:printtab(18)"by"
  251. 58060 print:printspc(fncn(len(nm$)))"[158]"nm$""
  252. 58070 printspc(12)"[195]opyright 1986"
  253. 58080 print"       [159] [195]ommodore [208]ublications"
  254. 58090 print"     [158][204][207][193][196][211][212][193][210] is not public domain."
  255. 58100 print:print"  [208]lease respect the author's rights."
  256. 58110 print:print"      [208]ress space bar to continue."
  257. 58120 forcc=1to48:getk$:ifk$=" "then58150
  258. 58130 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
  259. 58140 next:goto58110
  260. 58150 printc$chr$(142):return
  261. 60000 rem quit for sure?
  262. 60005 printcb$;"";
  263. 60010 print"             quit for sure?[144]                              "
  264. 60020 poke198,0:wait198,1:getdd$:ifdd$<>"y"thenreturn
  265. 60030 :
  266. 63000 sys65418:poke53269,0:poke54296,0
  267. 63002 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  268. 63010 ifer<>63thenend
  269. 63020 load"hello connect",8
  270.